//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_spi(SotoInternal) import SotoCore

extension EMRServerless {
    // MARK: Enums

    public enum ApplicationState: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case created = "CREATED"
        case creating = "CREATING"
        case started = "STARTED"
        case starting = "STARTING"
        case stopped = "STOPPED"
        case stopping = "STOPPING"
        case terminated = "TERMINATED"
        public var description: String { return self.rawValue }
    }

    public enum Architecture: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case arm64 = "ARM64"
        case x8664 = "X86_64"
        public var description: String { return self.rawValue }
    }

    public enum JobRunMode: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case batch = "BATCH"
        case streaming = "STREAMING"
        public var description: String { return self.rawValue }
    }

    public enum JobRunState: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case cancelled = "CANCELLED"
        case cancelling = "CANCELLING"
        case failed = "FAILED"
        case pending = "PENDING"
        case queued = "QUEUED"
        case running = "RUNNING"
        case scheduled = "SCHEDULED"
        case submitted = "SUBMITTED"
        case success = "SUCCESS"
        public var description: String { return self.rawValue }
    }

    public enum JobDriver: AWSEncodableShape & AWSDecodableShape, Sendable {
        /// The job driver parameters specified for Hive.
        case hive(Hive)
        /// The job driver parameters specified for Spark.
        case sparkSubmit(SparkSubmit)

        public init(from decoder: Decoder) throws {
            let container = try decoder.container(keyedBy: CodingKeys.self)
            guard container.allKeys.count == 1, let key = container.allKeys.first else {
                let context = DecodingError.Context(
                    codingPath: container.codingPath,
                    debugDescription: "Expected exactly one key, but got \(container.allKeys.count)"
                )
                throw DecodingError.dataCorrupted(context)
            }
            switch key {
            case .hive:
                let value = try container.decode(Hive.self, forKey: .hive)
                self = .hive(value)
            case .sparkSubmit:
                let value = try container.decode(SparkSubmit.self, forKey: .sparkSubmit)
                self = .sparkSubmit(value)
            }
        }

        public func encode(to encoder: Encoder) throws {
            var container = encoder.container(keyedBy: CodingKeys.self)
            switch self {
            case .hive(let value):
                try container.encode(value, forKey: .hive)
            case .sparkSubmit(let value):
                try container.encode(value, forKey: .sparkSubmit)
            }
        }

        public func validate(name: String) throws {
            switch self {
            case .hive(let value):
                try value.validate(name: "\(name).hive")
            case .sparkSubmit(let value):
                try value.validate(name: "\(name).sparkSubmit")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case hive = "hive"
            case sparkSubmit = "sparkSubmit"
        }
    }

    // MARK: Shapes

    public struct Application: AWSDecodableShape {
        /// The ID of the application.
        public let applicationId: String
        /// The CPU architecture of an application.
        public let architecture: Architecture?
        /// The ARN of the application.
        public let arn: String
        /// The configuration for an application to automatically start on job submission.
        public let autoStartConfiguration: AutoStartConfig?
        /// The configuration for an application to automatically stop after a certain amount of time being idle.
        public let autoStopConfiguration: AutoStopConfig?
        /// The date and time when the application run was created.
        public let createdAt: Date
        /// The IAM Identity Center configuration applied to enable trusted identity propagation.
        public let identityCenterConfiguration: IdentityCenterConfiguration?
        /// The image configuration applied to all worker types.
        public let imageConfiguration: ImageConfiguration?
        /// The initial capacity of the application.
        public let initialCapacity: [String: InitialCapacityConfig]?
        /// The interactive configuration object that enables the interactive use cases for an application.
        public let interactiveConfiguration: InteractiveConfiguration?
        /// The maximum capacity of the application. This is cumulative across all workers at any given point in time during the lifespan of the application is created. No new resources will be created once any one of the defined limits is hit.
        public let maximumCapacity: MaximumAllowedResources?
        public let monitoringConfiguration: MonitoringConfiguration?
        /// The name of the application.
        public let name: String?
        /// The network configuration for customer VPC connectivity for the application.
        public let networkConfiguration: NetworkConfiguration?
        /// The Amazon EMR release associated with the application.
        public let releaseLabel: String
        /// The Configuration specifications of an application. Each configuration consists of a classification and properties. You use this parameter when creating or updating an application. To see the runtimeConfiguration object of an application, run the GetApplication API operation.
        public let runtimeConfiguration: [Configuration]?
        /// The scheduler configuration for batch and streaming jobs running on this application. Supported with release labels emr-7.0.0 and above.
        public let schedulerConfiguration: SchedulerConfiguration?
        /// The state of the application.
        public let state: ApplicationState
        /// The state details of the application.
        public let stateDetails: String?
        /// The tags assigned to the application.
        public let tags: [String: String]?
        /// The type of application, such as Spark or Hive.
        public let type: String
        /// The date and time when the application run was last updated.
        public let updatedAt: Date
        /// The specification applied to each worker type.
        public let workerTypeSpecifications: [String: WorkerTypeSpecification]?

        @inlinable
        public init(applicationId: String, architecture: Architecture? = nil, arn: String, autoStartConfiguration: AutoStartConfig? = nil, autoStopConfiguration: AutoStopConfig? = nil, createdAt: Date, identityCenterConfiguration: IdentityCenterConfiguration? = nil, imageConfiguration: ImageConfiguration? = nil, initialCapacity: [String: InitialCapacityConfig]? = nil, interactiveConfiguration: InteractiveConfiguration? = nil, maximumCapacity: MaximumAllowedResources? = nil, monitoringConfiguration: MonitoringConfiguration? = nil, name: String? = nil, networkConfiguration: NetworkConfiguration? = nil, releaseLabel: String, runtimeConfiguration: [Configuration]? = nil, schedulerConfiguration: SchedulerConfiguration? = nil, state: ApplicationState, stateDetails: String? = nil, tags: [String: String]? = nil, type: String, updatedAt: Date, workerTypeSpecifications: [String: WorkerTypeSpecification]? = nil) {
            self.applicationId = applicationId
            self.architecture = architecture
            self.arn = arn
            self.autoStartConfiguration = autoStartConfiguration
            self.autoStopConfiguration = autoStopConfiguration
            self.createdAt = createdAt
            self.identityCenterConfiguration = identityCenterConfiguration
            self.imageConfiguration = imageConfiguration
            self.initialCapacity = initialCapacity
            self.interactiveConfiguration = interactiveConfiguration
            self.maximumCapacity = maximumCapacity
            self.monitoringConfiguration = monitoringConfiguration
            self.name = name
            self.networkConfiguration = networkConfiguration
            self.releaseLabel = releaseLabel
            self.runtimeConfiguration = runtimeConfiguration
            self.schedulerConfiguration = schedulerConfiguration
            self.state = state
            self.stateDetails = stateDetails
            self.tags = tags
            self.type = type
            self.updatedAt = updatedAt
            self.workerTypeSpecifications = workerTypeSpecifications
        }

        private enum CodingKeys: String, CodingKey {
            case applicationId = "applicationId"
            case architecture = "architecture"
            case arn = "arn"
            case autoStartConfiguration = "autoStartConfiguration"
            case autoStopConfiguration = "autoStopConfiguration"
            case createdAt = "createdAt"
            case identityCenterConfiguration = "identityCenterConfiguration"
            case imageConfiguration = "imageConfiguration"
            case initialCapacity = "initialCapacity"
            case interactiveConfiguration = "interactiveConfiguration"
            case maximumCapacity = "maximumCapacity"
            case monitoringConfiguration = "monitoringConfiguration"
            case name = "name"
            case networkConfiguration = "networkConfiguration"
            case releaseLabel = "releaseLabel"
            case runtimeConfiguration = "runtimeConfiguration"
            case schedulerConfiguration = "schedulerConfiguration"
            case state = "state"
            case stateDetails = "stateDetails"
            case tags = "tags"
            case type = "type"
            case updatedAt = "updatedAt"
            case workerTypeSpecifications = "workerTypeSpecifications"
        }
    }

    public struct ApplicationSummary: AWSDecodableShape {
        /// The CPU architecture of an application.
        public let architecture: Architecture?
        /// The ARN of the application.
        public let arn: String
        /// The date and time when the application was created.
        public let createdAt: Date
        /// The ID of the application.
        public let id: String
        /// The name of the application.
        public let name: String?
        /// The Amazon EMR release associated with the application.
        public let releaseLabel: String
        /// The state of the application.
        public let state: ApplicationState
        /// The state details of the application.
        public let stateDetails: String?
        /// The type of application, such as Spark or Hive.
        public let type: String
        /// The date and time when the application was last updated.
        public let updatedAt: Date

        @inlinable
        public init(architecture: Architecture? = nil, arn: String, createdAt: Date, id: String, name: String? = nil, releaseLabel: String, state: ApplicationState, stateDetails: String? = nil, type: String, updatedAt: Date) {
            self.architecture = architecture
            self.arn = arn
            self.createdAt = createdAt
            self.id = id
            self.name = name
            self.releaseLabel = releaseLabel
            self.state = state
            self.stateDetails = stateDetails
            self.type = type
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case architecture = "architecture"
            case arn = "arn"
            case createdAt = "createdAt"
            case id = "id"
            case name = "name"
            case releaseLabel = "releaseLabel"
            case state = "state"
            case stateDetails = "stateDetails"
            case type = "type"
            case updatedAt = "updatedAt"
        }
    }

    public struct AutoStartConfig: AWSEncodableShape & AWSDecodableShape {
        /// Enables the application to automatically start on job submission. Defaults to true.
        public let enabled: Bool?

        @inlinable
        public init(enabled: Bool? = nil) {
            self.enabled = enabled
        }

        private enum CodingKeys: String, CodingKey {
            case enabled = "enabled"
        }
    }

    public struct AutoStopConfig: AWSEncodableShape & AWSDecodableShape {
        /// Enables the application to automatically stop after a certain amount of time being idle. Defaults to true.
        public let enabled: Bool?
        /// The amount of idle time in minutes after which your application will automatically stop. Defaults to 15 minutes.
        public let idleTimeoutMinutes: Int?

        @inlinable
        public init(enabled: Bool? = nil, idleTimeoutMinutes: Int? = nil) {
            self.enabled = enabled
            self.idleTimeoutMinutes = idleTimeoutMinutes
        }

        private enum CodingKeys: String, CodingKey {
            case enabled = "enabled"
            case idleTimeoutMinutes = "idleTimeoutMinutes"
        }
    }

    public struct CancelJobRunRequest: AWSEncodableShape {
        /// The ID of the application on which the job run will be canceled.
        public let applicationId: String
        /// The ID of the job run to cancel.
        public let jobRunId: String
        /// The duration in seconds to wait before forcefully terminating the job after cancellation is requested.
        public let shutdownGracePeriodInSeconds: Int?

        @inlinable
        public init(applicationId: String, jobRunId: String, shutdownGracePeriodInSeconds: Int? = nil) {
            self.applicationId = applicationId
            self.jobRunId = jobRunId
            self.shutdownGracePeriodInSeconds = shutdownGracePeriodInSeconds
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.applicationId, key: "applicationId")
            request.encodePath(self.jobRunId, key: "jobRunId")
            request.encodeQuery(self.shutdownGracePeriodInSeconds, key: "shutdownGracePeriodInSeconds")
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationId, name: "applicationId", parent: name, max: 64)
            try self.validate(self.applicationId, name: "applicationId", parent: name, min: 1)
            try self.validate(self.applicationId, name: "applicationId", parent: name, pattern: "^[0-9a-z]+$")
            try self.validate(self.jobRunId, name: "jobRunId", parent: name, max: 64)
            try self.validate(self.jobRunId, name: "jobRunId", parent: name, min: 1)
            try self.validate(self.jobRunId, name: "jobRunId", parent: name, pattern: "^[0-9a-z]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct CancelJobRunResponse: AWSDecodableShape {
        /// The output contains the application ID on which the job run is cancelled.
        public let applicationId: String
        /// The output contains the ID of the cancelled job run.
        public let jobRunId: String

        @inlinable
        public init(applicationId: String, jobRunId: String) {
            self.applicationId = applicationId
            self.jobRunId = jobRunId
        }

        private enum CodingKeys: String, CodingKey {
            case applicationId = "applicationId"
            case jobRunId = "jobRunId"
        }
    }

    public struct CloudWatchLoggingConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Enables CloudWatch logging.
        public let enabled: Bool
        /// The Key Management Service (KMS) key ARN to encrypt the logs that you store in CloudWatch Logs.
        public let encryptionKeyArn: String?
        /// The name of the log group in Amazon CloudWatch Logs where you want to publish your logs.
        public let logGroupName: String?
        /// Prefix for the CloudWatch log stream name.
        public let logStreamNamePrefix: String?
        /// The types of logs that you want to publish to CloudWatch. If you don't specify any log types, driver STDOUT and STDERR logs will be published to CloudWatch Logs by default. For more information including the supported worker types for Hive and Spark, see Logging for EMR Serverless with CloudWatch.    Key Valid Values: SPARK_DRIVER, SPARK_EXECUTOR, HIVE_DRIVER, TEZ_TASK     Array Members Valid Values: STDOUT, STDERR, HIVE_LOG, TEZ_AM, SYSTEM_LOGS
        public let logTypes: [String: [String]]?

        @inlinable
        public init(enabled: Bool, encryptionKeyArn: String? = nil, logGroupName: String? = nil, logStreamNamePrefix: String? = nil, logTypes: [String: [String]]? = nil) {
            self.enabled = enabled
            self.encryptionKeyArn = encryptionKeyArn
            self.logGroupName = logGroupName
            self.logStreamNamePrefix = logStreamNamePrefix
            self.logTypes = logTypes
        }

        public func validate(name: String) throws {
            try self.validate(self.encryptionKeyArn, name: "encryptionKeyArn", parent: name, max: 2048)
            try self.validate(self.encryptionKeyArn, name: "encryptionKeyArn", parent: name, min: 20)
            try self.validate(self.encryptionKeyArn, name: "encryptionKeyArn", parent: name, pattern: "^arn:(aws[a-zA-Z0-9-]*):kms:[a-zA-Z0-9\\-]*:([0-9]{12}):key\\/[a-zA-Z0-9-]+$")
            try self.validate(self.logGroupName, name: "logGroupName", parent: name, max: 512)
            try self.validate(self.logGroupName, name: "logGroupName", parent: name, min: 1)
            try self.validate(self.logGroupName, name: "logGroupName", parent: name, pattern: "^[\\.\\-_/#A-Za-z0-9]+$")
            try self.validate(self.logStreamNamePrefix, name: "logStreamNamePrefix", parent: name, max: 512)
            try self.validate(self.logStreamNamePrefix, name: "logStreamNamePrefix", parent: name, min: 1)
            try self.validate(self.logStreamNamePrefix, name: "logStreamNamePrefix", parent: name, pattern: "^[^:*]*$")
            try self.logTypes?.forEach {
                try validate($0.key, name: "logTypes.key", parent: name, max: 50)
                try validate($0.key, name: "logTypes.key", parent: name, min: 1)
                try validate($0.key, name: "logTypes.key", parent: name, pattern: "^[a-zA-Z]+[-_]*[a-zA-Z]+$")
                try validate($0.value, name: "logTypes[\"\($0.key)\"]", parent: name, max: 5)
                try validate($0.value, name: "logTypes[\"\($0.key)\"]", parent: name, min: 1)
            }
            try self.validate(self.logTypes, name: "logTypes", parent: name, max: 4)
            try self.validate(self.logTypes, name: "logTypes", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case enabled = "enabled"
            case encryptionKeyArn = "encryptionKeyArn"
            case logGroupName = "logGroupName"
            case logStreamNamePrefix = "logStreamNamePrefix"
            case logTypes = "logTypes"
        }
    }

    public struct Configuration: AWSEncodableShape & AWSDecodableShape {
        /// The classification within a configuration.
        public let classification: String
        /// A list of additional configurations to apply within a configuration object.
        public let configurations: [Configuration]?
        /// A set of properties specified within a configuration classification.
        public let properties: [String: String]?

        @inlinable
        public init(classification: String, configurations: [Configuration]? = nil, properties: [String: String]? = nil) {
            self.classification = classification
            self.configurations = configurations
            self.properties = properties
        }

        public func validate(name: String) throws {
            try self.validate(self.classification, name: "classification", parent: name, max: 1024)
            try self.validate(self.classification, name: "classification", parent: name, min: 1)
            try self.validate(self.classification, name: "classification", parent: name, pattern: ".*\\S.*")
            try self.configurations?.forEach {
                try $0.validate(name: "\(name).configurations[]")
            }
            try self.validate(self.configurations, name: "configurations", parent: name, max: 100)
            try self.properties?.forEach {
                try validate($0.key, name: "properties.key", parent: name, max: 1024)
                try validate($0.key, name: "properties.key", parent: name, min: 1)
                try validate($0.key, name: "properties.key", parent: name, pattern: "^.*\\S.*$")
                try validate($0.value, name: "properties[\"\($0.key)\"]", parent: name, max: 1024)
                try validate($0.value, name: "properties[\"\($0.key)\"]", parent: name, pattern: "^.*\\S.*$")
            }
            try self.validate(self.properties, name: "properties", parent: name, max: 100)
        }

        private enum CodingKeys: String, CodingKey {
            case classification = "classification"
            case configurations = "configurations"
            case properties = "properties"
        }
    }

    public struct ConfigurationOverrides: AWSEncodableShape & AWSDecodableShape {
        /// The override configurations for the application.
        public let applicationConfiguration: [Configuration]?
        /// The override configurations for monitoring.
        public let monitoringConfiguration: MonitoringConfiguration?

        @inlinable
        public init(applicationConfiguration: [Configuration]? = nil, monitoringConfiguration: MonitoringConfiguration? = nil) {
            self.applicationConfiguration = applicationConfiguration
            self.monitoringConfiguration = monitoringConfiguration
        }

        public func validate(name: String) throws {
            try self.applicationConfiguration?.forEach {
                try $0.validate(name: "\(name).applicationConfiguration[]")
            }
            try self.validate(self.applicationConfiguration, name: "applicationConfiguration", parent: name, max: 100)
            try self.monitoringConfiguration?.validate(name: "\(name).monitoringConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case applicationConfiguration = "applicationConfiguration"
            case monitoringConfiguration = "monitoringConfiguration"
        }
    }

    public struct CreateApplicationRequest: AWSEncodableShape {
        /// The CPU architecture of an application.
        public let architecture: Architecture?
        /// The configuration for an application to automatically start on job submission.
        public let autoStartConfiguration: AutoStartConfig?
        /// The configuration for an application to automatically stop after a certain amount of time being idle.
        public let autoStopConfiguration: AutoStopConfig?
        /// The client idempotency token of the application to create. Its value must be unique for each request.
        public let clientToken: String
        /// The IAM Identity Center Configuration accepts the Identity Center instance parameter required to enable trusted identity propagation. This configuration allows identity propagation between integrated services and the Identity Center instance.
        public let identityCenterConfiguration: IdentityCenterConfigurationInput?
        /// The image configuration for all worker types. You can either set this parameter or imageConfiguration for each worker type in workerTypeSpecifications.
        public let imageConfiguration: ImageConfigurationInput?
        /// The capacity to initialize when the application is created.
        public let initialCapacity: [String: InitialCapacityConfig]?
        /// The interactive configuration object that enables the interactive use cases to use when running an application.
        public let interactiveConfiguration: InteractiveConfiguration?
        /// The maximum capacity to allocate when the application is created. This is cumulative across all workers at any given point in time, not just when an application is created. No new resources will be created once any one of the defined limits is hit.
        public let maximumCapacity: MaximumAllowedResources?
        /// The configuration setting for monitoring.
        public let monitoringConfiguration: MonitoringConfiguration?
        /// The name of the application.
        public let name: String?
        /// The network configuration for customer VPC connectivity.
        public let networkConfiguration: NetworkConfiguration?
        /// The Amazon EMR release associated with the application.
        public let releaseLabel: String
        /// The Configuration specifications to use when creating an application. Each configuration consists of a classification and properties. This configuration is applied to all the job runs submitted under the application.
        public let runtimeConfiguration: [Configuration]?
        /// The scheduler configuration for batch and streaming jobs running on this application. Supported with release labels emr-7.0.0 and above.
        public let schedulerConfiguration: SchedulerConfiguration?
        /// The tags assigned to the application.
        public let tags: [String: String]?
        /// The type of application you want to start, such as Spark or Hive.
        public let type: String
        /// The key-value pairs that specify worker type to WorkerTypeSpecificationInput. This parameter must contain all valid worker types for a Spark or Hive application. Valid worker types include Driver and Executor for Spark applications and HiveDriver and TezTask for Hive applications. You can either set image details in this parameter for each worker type, or in imageConfiguration for all worker types.
        public let workerTypeSpecifications: [String: WorkerTypeSpecificationInput]?

        @inlinable
        public init(architecture: Architecture? = nil, autoStartConfiguration: AutoStartConfig? = nil, autoStopConfiguration: AutoStopConfig? = nil, clientToken: String = CreateApplicationRequest.idempotencyToken(), identityCenterConfiguration: IdentityCenterConfigurationInput? = nil, imageConfiguration: ImageConfigurationInput? = nil, initialCapacity: [String: InitialCapacityConfig]? = nil, interactiveConfiguration: InteractiveConfiguration? = nil, maximumCapacity: MaximumAllowedResources? = nil, monitoringConfiguration: MonitoringConfiguration? = nil, name: String? = nil, networkConfiguration: NetworkConfiguration? = nil, releaseLabel: String, runtimeConfiguration: [Configuration]? = nil, schedulerConfiguration: SchedulerConfiguration? = nil, tags: [String: String]? = nil, type: String, workerTypeSpecifications: [String: WorkerTypeSpecificationInput]? = nil) {
            self.architecture = architecture
            self.autoStartConfiguration = autoStartConfiguration
            self.autoStopConfiguration = autoStopConfiguration
            self.clientToken = clientToken
            self.identityCenterConfiguration = identityCenterConfiguration
            self.imageConfiguration = imageConfiguration
            self.initialCapacity = initialCapacity
            self.interactiveConfiguration = interactiveConfiguration
            self.maximumCapacity = maximumCapacity
            self.monitoringConfiguration = monitoringConfiguration
            self.name = name
            self.networkConfiguration = networkConfiguration
            self.releaseLabel = releaseLabel
            self.runtimeConfiguration = runtimeConfiguration
            self.schedulerConfiguration = schedulerConfiguration
            self.tags = tags
            self.type = type
            self.workerTypeSpecifications = workerTypeSpecifications
        }

        public func validate(name: String) throws {
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 64)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "^[A-Za-z0-9._-]+$")
            try self.identityCenterConfiguration?.validate(name: "\(name).identityCenterConfiguration")
            try self.imageConfiguration?.validate(name: "\(name).imageConfiguration")
            try self.initialCapacity?.forEach {
                try validate($0.key, name: "initialCapacity.key", parent: name, max: 50)
                try validate($0.key, name: "initialCapacity.key", parent: name, min: 1)
                try validate($0.key, name: "initialCapacity.key", parent: name, pattern: "^[a-zA-Z]+[-_]*[a-zA-Z]+$")
                try $0.value.validate(name: "\(name).initialCapacity[\"\($0.key)\"]")
            }
            try self.validate(self.initialCapacity, name: "initialCapacity", parent: name, max: 10)
            try self.maximumCapacity?.validate(name: "\(name).maximumCapacity")
            try self.monitoringConfiguration?.validate(name: "\(name).monitoringConfiguration")
            try self.validate(self.name, name: "name", parent: name, max: 64)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[A-Za-z0-9._/#-]+$")
            try self.networkConfiguration?.validate(name: "\(name).networkConfiguration")
            try self.validate(self.releaseLabel, name: "releaseLabel", parent: name, max: 64)
            try self.validate(self.releaseLabel, name: "releaseLabel", parent: name, min: 1)
            try self.validate(self.releaseLabel, name: "releaseLabel", parent: name, pattern: "^[A-Za-z0-9._/-]+$")
            try self.runtimeConfiguration?.forEach {
                try $0.validate(name: "\(name).runtimeConfiguration[]")
            }
            try self.validate(self.runtimeConfiguration, name: "runtimeConfiguration", parent: name, max: 100)
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^[A-Za-z0-9 /_.:=+@-]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "^[A-Za-z0-9 /_.:=+@-]*$")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
            try self.validate(self.type, name: "type", parent: name, max: 64)
            try self.validate(self.type, name: "type", parent: name, min: 1)
            try self.workerTypeSpecifications?.forEach {
                try validate($0.key, name: "workerTypeSpecifications.key", parent: name, max: 50)
                try validate($0.key, name: "workerTypeSpecifications.key", parent: name, min: 1)
                try validate($0.key, name: "workerTypeSpecifications.key", parent: name, pattern: "^[a-zA-Z]+[-_]*[a-zA-Z]+$")
                try $0.value.validate(name: "\(name).workerTypeSpecifications[\"\($0.key)\"]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case architecture = "architecture"
            case autoStartConfiguration = "autoStartConfiguration"
            case autoStopConfiguration = "autoStopConfiguration"
            case clientToken = "clientToken"
            case identityCenterConfiguration = "identityCenterConfiguration"
            case imageConfiguration = "imageConfiguration"
            case initialCapacity = "initialCapacity"
            case interactiveConfiguration = "interactiveConfiguration"
            case maximumCapacity = "maximumCapacity"
            case monitoringConfiguration = "monitoringConfiguration"
            case name = "name"
            case networkConfiguration = "networkConfiguration"
            case releaseLabel = "releaseLabel"
            case runtimeConfiguration = "runtimeConfiguration"
            case schedulerConfiguration = "schedulerConfiguration"
            case tags = "tags"
            case type = "type"
            case workerTypeSpecifications = "workerTypeSpecifications"
        }
    }

    public struct CreateApplicationResponse: AWSDecodableShape {
        /// The output contains the application ID.
        public let applicationId: String
        /// The output contains the ARN of the application.
        public let arn: String
        /// The output contains the name of the application.
        public let name: String?

        @inlinable
        public init(applicationId: String, arn: String, name: String? = nil) {
            self.applicationId = applicationId
            self.arn = arn
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case applicationId = "applicationId"
            case arn = "arn"
            case name = "name"
        }
    }

    public struct DeleteApplicationRequest: AWSEncodableShape {
        /// The ID of the application that will be deleted.
        public let applicationId: String

        @inlinable
        public init(applicationId: String) {
            self.applicationId = applicationId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.applicationId, key: "applicationId")
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationId, name: "applicationId", parent: name, max: 64)
            try self.validate(self.applicationId, name: "applicationId", parent: name, min: 1)
            try self.validate(self.applicationId, name: "applicationId", parent: name, pattern: "^[0-9a-z]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteApplicationResponse: AWSDecodableShape {
        public init() {}
    }

    public struct GetApplicationRequest: AWSEncodableShape {
        /// The ID of the application that will be described.
        public let applicationId: String

        @inlinable
        public init(applicationId: String) {
            self.applicationId = applicationId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.applicationId, key: "applicationId")
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationId, name: "applicationId", parent: name, max: 64)
            try self.validate(self.applicationId, name: "applicationId", parent: name, min: 1)
            try self.validate(self.applicationId, name: "applicationId", parent: name, pattern: "^[0-9a-z]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetApplicationResponse: AWSDecodableShape {
        /// The output displays information about the specified application.
        public let application: Application

        @inlinable
        public init(application: Application) {
            self.application = application
        }

        private enum CodingKeys: String, CodingKey {
            case application = "application"
        }
    }

    public struct GetDashboardForJobRunRequest: AWSEncodableShape {
        /// Allows access to system profile logs for Lake Formation-enabled jobs. Default is false.
        public let accessSystemProfileLogs: Bool?
        /// The ID of the application.
        public let applicationId: String
        /// An optimal parameter that indicates the amount of attempts for the job. If not specified, this value defaults to the attempt of the latest job.
        public let attempt: Int?
        /// The ID of the job run.
        public let jobRunId: String

        @inlinable
        public init(accessSystemProfileLogs: Bool? = nil, applicationId: String, attempt: Int? = nil, jobRunId: String) {
            self.accessSystemProfileLogs = accessSystemProfileLogs
            self.applicationId = applicationId
            self.attempt = attempt
            self.jobRunId = jobRunId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.accessSystemProfileLogs, key: "accessSystemProfileLogs")
            request.encodePath(self.applicationId, key: "applicationId")
            request.encodeQuery(self.attempt, key: "attempt")
            request.encodePath(self.jobRunId, key: "jobRunId")
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationId, name: "applicationId", parent: name, max: 64)
            try self.validate(self.applicationId, name: "applicationId", parent: name, min: 1)
            try self.validate(self.applicationId, name: "applicationId", parent: name, pattern: "^[0-9a-z]+$")
            try self.validate(self.attempt, name: "attempt", parent: name, min: 1)
            try self.validate(self.jobRunId, name: "jobRunId", parent: name, max: 64)
            try self.validate(self.jobRunId, name: "jobRunId", parent: name, min: 1)
            try self.validate(self.jobRunId, name: "jobRunId", parent: name, pattern: "^[0-9a-z]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetDashboardForJobRunResponse: AWSDecodableShape {
        /// The URL to view job run's dashboard.
        public let url: String?

        @inlinable
        public init(url: String? = nil) {
            self.url = url
        }

        private enum CodingKeys: String, CodingKey {
            case url = "url"
        }
    }

    public struct GetJobRunRequest: AWSEncodableShape {
        /// The ID of the application on which the job run is submitted.
        public let applicationId: String
        /// An optimal parameter that indicates the amount of attempts for the job. If not specified, this value defaults to the attempt of the latest job.
        public let attempt: Int?
        /// The ID of the job run.
        public let jobRunId: String

        @inlinable
        public init(applicationId: String, attempt: Int? = nil, jobRunId: String) {
            self.applicationId = applicationId
            self.attempt = attempt
            self.jobRunId = jobRunId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.applicationId, key: "applicationId")
            request.encodeQuery(self.attempt, key: "attempt")
            request.encodePath(self.jobRunId, key: "jobRunId")
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationId, name: "applicationId", parent: name, max: 64)
            try self.validate(self.applicationId, name: "applicationId", parent: name, min: 1)
            try self.validate(self.applicationId, name: "applicationId", parent: name, pattern: "^[0-9a-z]+$")
            try self.validate(self.attempt, name: "attempt", parent: name, min: 1)
            try self.validate(self.jobRunId, name: "jobRunId", parent: name, max: 64)
            try self.validate(self.jobRunId, name: "jobRunId", parent: name, min: 1)
            try self.validate(self.jobRunId, name: "jobRunId", parent: name, pattern: "^[0-9a-z]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetJobRunResponse: AWSDecodableShape {
        /// The output displays information about the job run.
        public let jobRun: JobRun

        @inlinable
        public init(jobRun: JobRun) {
            self.jobRun = jobRun
        }

        private enum CodingKeys: String, CodingKey {
            case jobRun = "jobRun"
        }
    }

    public struct Hive: AWSEncodableShape & AWSDecodableShape {
        /// The query file for the Hive job run.
        public let initQueryFile: String?
        /// The parameters for the Hive job run.
        public let parameters: String?
        /// The query for the Hive job run.
        public let query: String

        @inlinable
        public init(initQueryFile: String? = nil, parameters: String? = nil, query: String) {
            self.initQueryFile = initQueryFile
            self.parameters = parameters
            self.query = query
        }

        public func validate(name: String) throws {
            try self.validate(self.initQueryFile, name: "initQueryFile", parent: name, max: 256)
            try self.validate(self.initQueryFile, name: "initQueryFile", parent: name, min: 1)
            try self.validate(self.initQueryFile, name: "initQueryFile", parent: name, pattern: ".*\\S.*")
            try self.validate(self.parameters, name: "parameters", parent: name, max: 102400)
            try self.validate(self.parameters, name: "parameters", parent: name, min: 1)
            try self.validate(self.parameters, name: "parameters", parent: name, pattern: ".*\\S.*")
            try self.validate(self.query, name: "query", parent: name, max: 10280)
            try self.validate(self.query, name: "query", parent: name, min: 1)
            try self.validate(self.query, name: "query", parent: name, pattern: ".*\\S.*")
        }

        private enum CodingKeys: String, CodingKey {
            case initQueryFile = "initQueryFile"
            case parameters = "parameters"
            case query = "query"
        }
    }

    public struct IdentityCenterConfiguration: AWSDecodableShape {
        /// The ARN of the EMR Serverless created IAM Identity Center Application that provides trusted-identity propagation.
        public let identityCenterApplicationArn: String?
        /// The ARN of the IAM Identity Center instance.
        public let identityCenterInstanceArn: String?

        @inlinable
        public init(identityCenterApplicationArn: String? = nil, identityCenterInstanceArn: String? = nil) {
            self.identityCenterApplicationArn = identityCenterApplicationArn
            self.identityCenterInstanceArn = identityCenterInstanceArn
        }

        private enum CodingKeys: String, CodingKey {
            case identityCenterApplicationArn = "identityCenterApplicationArn"
            case identityCenterInstanceArn = "identityCenterInstanceArn"
        }
    }

    public struct IdentityCenterConfigurationInput: AWSEncodableShape {
        /// The ARN of the IAM Identity Center instance.
        public let identityCenterInstanceArn: String?

        @inlinable
        public init(identityCenterInstanceArn: String? = nil) {
            self.identityCenterInstanceArn = identityCenterInstanceArn
        }

        public func validate(name: String) throws {
            try self.validate(self.identityCenterInstanceArn, name: "identityCenterInstanceArn", parent: name, max: 1024)
            try self.validate(self.identityCenterInstanceArn, name: "identityCenterInstanceArn", parent: name, min: 10)
            try self.validate(self.identityCenterInstanceArn, name: "identityCenterInstanceArn", parent: name, pattern: "^arn:(aws[a-zA-Z0-9-]*):sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}$")
        }

        private enum CodingKeys: String, CodingKey {
            case identityCenterInstanceArn = "identityCenterInstanceArn"
        }
    }

    public struct ImageConfiguration: AWSDecodableShape {
        /// The image URI.
        public let imageUri: String
        /// The SHA256 digest of the image URI. This indicates which specific image the application is configured for. The image digest doesn't exist until an application has started.
        public let resolvedImageDigest: String?

        @inlinable
        public init(imageUri: String, resolvedImageDigest: String? = nil) {
            self.imageUri = imageUri
            self.resolvedImageDigest = resolvedImageDigest
        }

        private enum CodingKeys: String, CodingKey {
            case imageUri = "imageUri"
            case resolvedImageDigest = "resolvedImageDigest"
        }
    }

    public struct ImageConfigurationInput: AWSEncodableShape {
        /// The URI of an image in the Amazon ECR registry. This field is required when you create a new application. If you leave this field blank in an update, Amazon EMR will remove the image configuration.
        public let imageUri: String?

        @inlinable
        public init(imageUri: String? = nil) {
            self.imageUri = imageUri
        }

        public func validate(name: String) throws {
            try self.validate(self.imageUri, name: "imageUri", parent: name, max: 1024)
            try self.validate(self.imageUri, name: "imageUri", parent: name, min: 1)
            try self.validate(self.imageUri, name: "imageUri", parent: name, pattern: "^([0-9]{12})\\.dkr\\.ecr\\.([a-z0-9-]+).([a-z0-9._-]+)\\/((?:[a-z0-9]+(?:[-._][a-z0-9]+)*/)*[a-z0-9]+(?:[-._][a-z0-9]+)*)(?::([a-zA-Z0-9_]+[a-zA-Z0-9-._]*)|@(sha256:[0-9a-f]{64}))$")
        }

        private enum CodingKeys: String, CodingKey {
            case imageUri = "imageUri"
        }
    }

    public struct InitialCapacityConfig: AWSEncodableShape & AWSDecodableShape {
        /// The resource configuration of the initial capacity configuration.
        public let workerConfiguration: WorkerResourceConfig?
        /// The number of workers in the initial capacity configuration.
        public let workerCount: Int64

        @inlinable
        public init(workerConfiguration: WorkerResourceConfig? = nil, workerCount: Int64) {
            self.workerConfiguration = workerConfiguration
            self.workerCount = workerCount
        }

        public func validate(name: String) throws {
            try self.workerConfiguration?.validate(name: "\(name).workerConfiguration")
            try self.validate(self.workerCount, name: "workerCount", parent: name, max: 1000000)
            try self.validate(self.workerCount, name: "workerCount", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case workerConfiguration = "workerConfiguration"
            case workerCount = "workerCount"
        }
    }

    public struct InteractiveConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Enables an Apache Livy endpoint that you can connect to and run interactive jobs.
        public let livyEndpointEnabled: Bool?
        /// Enables you to connect an application to Amazon EMR Studio to run interactive workloads in a notebook.
        public let studioEnabled: Bool?

        @inlinable
        public init(livyEndpointEnabled: Bool? = nil, studioEnabled: Bool? = nil) {
            self.livyEndpointEnabled = livyEndpointEnabled
            self.studioEnabled = studioEnabled
        }

        private enum CodingKeys: String, CodingKey {
            case livyEndpointEnabled = "livyEndpointEnabled"
            case studioEnabled = "studioEnabled"
        }
    }

    public struct JobRun: AWSDecodableShape {
        /// The ID of the application the job is running on.
        public let applicationId: String
        /// The execution role ARN of the job run.
        public let arn: String
        /// The attempt of the job run.
        public let attempt: Int?
        /// The date and time of when the job run attempt was created.
        public let attemptCreatedAt: Date?
        /// The date and time of when the job run attempt was last updated.
        public let attemptUpdatedAt: Date?
        /// The aggregate vCPU, memory, and storage that Amazon Web Services has billed for the job run. The billed resources include a 1-minute minimum usage for workers, plus additional storage over 20 GB per worker. Note that billed resources do not include usage for idle pre-initialized workers.
        public let billedResourceUtilization: ResourceUtilization?
        /// The configuration settings that are used to override default configuration.
        public let configurationOverrides: ConfigurationOverrides?
        /// The date and time when the job run was created.
        public let createdAt: Date
        /// The user who created the job run.
        public let createdBy: String
        /// The date and time when the job was terminated.
        public let endedAt: Date?
        public let executionIamPolicy: JobRunExecutionIamPolicy?
        /// The execution role ARN of the job run.
        public let executionRole: String
        /// Returns the job run timeout value from the StartJobRun call. If no timeout was specified, then it returns the default timeout of 720 minutes.
        public let executionTimeoutMinutes: Int64?
        /// The job driver for the job run.
        public let jobDriver: JobDriver
        /// The ID of the job run.
        public let jobRunId: String
        /// The mode of the job run.
        public let mode: JobRunMode?
        /// The optional job run name. This doesn't have to be unique.
        public let name: String?
        public let networkConfiguration: NetworkConfiguration?
        /// The total time for a job in the QUEUED state in milliseconds.
        public let queuedDurationMilliseconds: Int64?
        /// The Amazon EMR release associated with the application your job is running on.
        public let releaseLabel: String
        /// The retry policy of the job run.
        public let retryPolicy: RetryPolicy?
        /// The date and time when the job moved to the RUNNING state.
        public let startedAt: Date?
        /// The state of the job run.
        public let state: JobRunState
        /// The state details of the job run.
        public let stateDetails: String
        /// The tags assigned to the job run.
        public let tags: [String: String]?
        /// The job run total execution duration in seconds. This field is only available for job runs in a COMPLETED, FAILED, or CANCELLED state.
        public let totalExecutionDurationSeconds: Int?
        /// The aggregate vCPU, memory, and storage resources used from the time the job starts to execute, until the time the job terminates, rounded up to the nearest second.
        public let totalResourceUtilization: TotalResourceUtilization?
        /// The date and time when the job run was updated.
        public let updatedAt: Date

        @inlinable
        public init(applicationId: String, arn: String, attempt: Int? = nil, attemptCreatedAt: Date? = nil, attemptUpdatedAt: Date? = nil, billedResourceUtilization: ResourceUtilization? = nil, configurationOverrides: ConfigurationOverrides? = nil, createdAt: Date, createdBy: String, endedAt: Date? = nil, executionIamPolicy: JobRunExecutionIamPolicy? = nil, executionRole: String, executionTimeoutMinutes: Int64? = nil, jobDriver: JobDriver, jobRunId: String, mode: JobRunMode? = nil, name: String? = nil, networkConfiguration: NetworkConfiguration? = nil, queuedDurationMilliseconds: Int64? = nil, releaseLabel: String, retryPolicy: RetryPolicy? = nil, startedAt: Date? = nil, state: JobRunState, stateDetails: String, tags: [String: String]? = nil, totalExecutionDurationSeconds: Int? = nil, totalResourceUtilization: TotalResourceUtilization? = nil, updatedAt: Date) {
            self.applicationId = applicationId
            self.arn = arn
            self.attempt = attempt
            self.attemptCreatedAt = attemptCreatedAt
            self.attemptUpdatedAt = attemptUpdatedAt
            self.billedResourceUtilization = billedResourceUtilization
            self.configurationOverrides = configurationOverrides
            self.createdAt = createdAt
            self.createdBy = createdBy
            self.endedAt = endedAt
            self.executionIamPolicy = executionIamPolicy
            self.executionRole = executionRole
            self.executionTimeoutMinutes = executionTimeoutMinutes
            self.jobDriver = jobDriver
            self.jobRunId = jobRunId
            self.mode = mode
            self.name = name
            self.networkConfiguration = networkConfiguration
            self.queuedDurationMilliseconds = queuedDurationMilliseconds
            self.releaseLabel = releaseLabel
            self.retryPolicy = retryPolicy
            self.startedAt = startedAt
            self.state = state
            self.stateDetails = stateDetails
            self.tags = tags
            self.totalExecutionDurationSeconds = totalExecutionDurationSeconds
            self.totalResourceUtilization = totalResourceUtilization
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case applicationId = "applicationId"
            case arn = "arn"
            case attempt = "attempt"
            case attemptCreatedAt = "attemptCreatedAt"
            case attemptUpdatedAt = "attemptUpdatedAt"
            case billedResourceUtilization = "billedResourceUtilization"
            case configurationOverrides = "configurationOverrides"
            case createdAt = "createdAt"
            case createdBy = "createdBy"
            case endedAt = "endedAt"
            case executionIamPolicy = "executionIamPolicy"
            case executionRole = "executionRole"
            case executionTimeoutMinutes = "executionTimeoutMinutes"
            case jobDriver = "jobDriver"
            case jobRunId = "jobRunId"
            case mode = "mode"
            case name = "name"
            case networkConfiguration = "networkConfiguration"
            case queuedDurationMilliseconds = "queuedDurationMilliseconds"
            case releaseLabel = "releaseLabel"
            case retryPolicy = "retryPolicy"
            case startedAt = "startedAt"
            case state = "state"
            case stateDetails = "stateDetails"
            case tags = "tags"
            case totalExecutionDurationSeconds = "totalExecutionDurationSeconds"
            case totalResourceUtilization = "totalResourceUtilization"
            case updatedAt = "updatedAt"
        }
    }

    public struct JobRunAttemptSummary: AWSDecodableShape {
        /// The ID of the application the job is running on.
        public let applicationId: String
        /// The Amazon Resource Name (ARN) of the job run.
        public let arn: String
        /// The attempt number of the job run execution.
        public let attempt: Int?
        /// The date and time when the job run attempt was created.
        public let createdAt: Date
        /// The user who created the job run.
        public let createdBy: String
        /// The Amazon Resource Name (ARN) of the execution role of the job run..
        public let executionRole: String
        /// The ID of the job run attempt.
        public let id: String
        /// The date and time of when the job run was created.
        public let jobCreatedAt: Date
        /// The mode of the job run attempt.
        public let mode: JobRunMode?
        /// The name of the job run attempt.
        public let name: String?
        /// The Amazon EMR release label of the job run attempt.
        public let releaseLabel: String
        /// The state of the job run attempt.
        public let state: JobRunState
        /// The state details of the job run attempt.
        public let stateDetails: String
        /// The type of the job run, such as Spark or Hive.
        public let type: String?
        /// The date and time of when the job run attempt was last updated.
        public let updatedAt: Date

        @inlinable
        public init(applicationId: String, arn: String, attempt: Int? = nil, createdAt: Date, createdBy: String, executionRole: String, id: String, jobCreatedAt: Date, mode: JobRunMode? = nil, name: String? = nil, releaseLabel: String, state: JobRunState, stateDetails: String, type: String? = nil, updatedAt: Date) {
            self.applicationId = applicationId
            self.arn = arn
            self.attempt = attempt
            self.createdAt = createdAt
            self.createdBy = createdBy
            self.executionRole = executionRole
            self.id = id
            self.jobCreatedAt = jobCreatedAt
            self.mode = mode
            self.name = name
            self.releaseLabel = releaseLabel
            self.state = state
            self.stateDetails = stateDetails
            self.type = type
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case applicationId = "applicationId"
            case arn = "arn"
            case attempt = "attempt"
            case createdAt = "createdAt"
            case createdBy = "createdBy"
            case executionRole = "executionRole"
            case id = "id"
            case jobCreatedAt = "jobCreatedAt"
            case mode = "mode"
            case name = "name"
            case releaseLabel = "releaseLabel"
            case state = "state"
            case stateDetails = "stateDetails"
            case type = "type"
            case updatedAt = "updatedAt"
        }
    }

    public struct JobRunExecutionIamPolicy: AWSEncodableShape & AWSDecodableShape {
        /// An IAM inline policy to use as an execution IAM policy.
        public let policy: String?
        /// A list of Amazon Resource Names (ARNs) to use as an execution IAM policy.
        public let policyArns: [String]?

        @inlinable
        public init(policy: String? = nil, policyArns: [String]? = nil) {
            self.policy = policy
            self.policyArns = policyArns
        }

        public func validate(name: String) throws {
            try self.validate(self.policy, name: "policy", parent: name, max: 2048)
            try self.validate(self.policy, name: "policy", parent: name, min: 1)
            try self.validate(self.policy, name: "policy", parent: name, pattern: "^([\t\n\r -ÿ]+)$")
            try self.policyArns?.forEach {
                try validate($0, name: "policyArns[]", parent: name, max: 2048)
                try validate($0, name: "policyArns[]", parent: name, min: 20)
                try validate($0, name: "policyArns[]", parent: name, pattern: "^([\t\n\r -~ -퟿-�က0-ჿFF]+)$")
            }
            try self.validate(self.policyArns, name: "policyArns", parent: name, max: 10)
        }

        private enum CodingKeys: String, CodingKey {
            case policy = "policy"
            case policyArns = "policyArns"
        }
    }

    public struct JobRunSummary: AWSDecodableShape {
        /// The ID of the application the job is running on.
        public let applicationId: String
        /// The ARN of the job run.
        public let arn: String
        /// The attempt number of the job run execution.
        public let attempt: Int?
        /// The date and time of when the job run attempt was created.
        public let attemptCreatedAt: Date?
        /// The date and time of when the job run attempt was last updated.
        public let attemptUpdatedAt: Date?
        /// The date and time when the job run was created.
        public let createdAt: Date
        /// The user who created the job run.
        public let createdBy: String
        /// The execution role ARN of the job run.
        public let executionRole: String
        /// The ID of the job run.
        public let id: String
        /// The mode of the job run.
        public let mode: JobRunMode?
        /// The optional job run name. This doesn't have to be unique.
        public let name: String?
        /// The Amazon EMR release associated with the application your job is running on.
        public let releaseLabel: String
        /// The state of the job run.
        public let state: JobRunState
        /// The state details of the job run.
        public let stateDetails: String
        /// The type of job run, such as Spark or Hive.
        public let type: String?
        /// The date and time when the job run was last updated.
        public let updatedAt: Date

        @inlinable
        public init(applicationId: String, arn: String, attempt: Int? = nil, attemptCreatedAt: Date? = nil, attemptUpdatedAt: Date? = nil, createdAt: Date, createdBy: String, executionRole: String, id: String, mode: JobRunMode? = nil, name: String? = nil, releaseLabel: String, state: JobRunState, stateDetails: String, type: String? = nil, updatedAt: Date) {
            self.applicationId = applicationId
            self.arn = arn
            self.attempt = attempt
            self.attemptCreatedAt = attemptCreatedAt
            self.attemptUpdatedAt = attemptUpdatedAt
            self.createdAt = createdAt
            self.createdBy = createdBy
            self.executionRole = executionRole
            self.id = id
            self.mode = mode
            self.name = name
            self.releaseLabel = releaseLabel
            self.state = state
            self.stateDetails = stateDetails
            self.type = type
            self.updatedAt = updatedAt
        }

        private enum CodingKeys: String, CodingKey {
            case applicationId = "applicationId"
            case arn = "arn"
            case attempt = "attempt"
            case attemptCreatedAt = "attemptCreatedAt"
            case attemptUpdatedAt = "attemptUpdatedAt"
            case createdAt = "createdAt"
            case createdBy = "createdBy"
            case executionRole = "executionRole"
            case id = "id"
            case mode = "mode"
            case name = "name"
            case releaseLabel = "releaseLabel"
            case state = "state"
            case stateDetails = "stateDetails"
            case type = "type"
            case updatedAt = "updatedAt"
        }
    }

    public struct ListApplicationsRequest: AWSEncodableShape {
        /// The maximum number of applications that can be listed.
        public let maxResults: Int?
        /// The token for the next set of application results.
        public let nextToken: String?
        /// An optional filter for application states. Note that if this filter contains multiple states, the resulting list will be grouped by the state.
        public let states: [ApplicationState]?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil, states: [ApplicationState]? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.states = states
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.nextToken, key: "nextToken")
            request.encodeQuery(self.states, key: "states")
        }

        public func validate(name: String) throws {
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[A-Za-z0-9_=-]+$")
            try self.validate(self.states, name: "states", parent: name, max: 7)
            try self.validate(self.states, name: "states", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListApplicationsResponse: AWSDecodableShape {
        /// The output lists the specified applications.
        public let applications: [ApplicationSummary]
        /// The output displays the token for the next set of application results. This is required for pagination and is available as a response of the previous request.
        public let nextToken: String?

        @inlinable
        public init(applications: [ApplicationSummary], nextToken: String? = nil) {
            self.applications = applications
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case applications = "applications"
            case nextToken = "nextToken"
        }
    }

    public struct ListJobRunAttemptsRequest: AWSEncodableShape {
        /// The ID of the application for which to list job runs.
        public let applicationId: String
        /// The ID of the job run to list.
        public let jobRunId: String
        /// The maximum number of job run attempts to list.
        public let maxResults: Int?
        /// The token for the next set of job run attempt results.
        public let nextToken: String?

        @inlinable
        public init(applicationId: String, jobRunId: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.applicationId = applicationId
            self.jobRunId = jobRunId
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.applicationId, key: "applicationId")
            request.encodePath(self.jobRunId, key: "jobRunId")
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.nextToken, key: "nextToken")
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationId, name: "applicationId", parent: name, max: 64)
            try self.validate(self.applicationId, name: "applicationId", parent: name, min: 1)
            try self.validate(self.applicationId, name: "applicationId", parent: name, pattern: "^[0-9a-z]+$")
            try self.validate(self.jobRunId, name: "jobRunId", parent: name, max: 64)
            try self.validate(self.jobRunId, name: "jobRunId", parent: name, min: 1)
            try self.validate(self.jobRunId, name: "jobRunId", parent: name, pattern: "^[0-9a-z]+$")
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[A-Za-z0-9_=-]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListJobRunAttemptsResponse: AWSDecodableShape {
        /// The array of the listed job run attempt objects.
        public let jobRunAttempts: [JobRunAttemptSummary]
        /// The output displays the token for the next set of application results. This is required for pagination and is available as a response of the previous request.
        public let nextToken: String?

        @inlinable
        public init(jobRunAttempts: [JobRunAttemptSummary], nextToken: String? = nil) {
            self.jobRunAttempts = jobRunAttempts
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case jobRunAttempts = "jobRunAttempts"
            case nextToken = "nextToken"
        }
    }

    public struct ListJobRunsRequest: AWSEncodableShape {
        /// The ID of the application for which to list the job run.
        public let applicationId: String
        /// The lower bound of the option to filter by creation date and time.
        public let createdAtAfter: Date?
        /// The upper bound of the option to filter by creation date and time.
        public let createdAtBefore: Date?
        /// The maximum number of job runs that can be listed.
        public let maxResults: Int?
        /// The mode of the job runs to list.
        public let mode: JobRunMode?
        /// The token for the next set of job run results.
        public let nextToken: String?
        /// An optional filter for job run states. Note that if this filter contains multiple states, the resulting list will be grouped by the state.
        public let states: [JobRunState]?

        @inlinable
        public init(applicationId: String, createdAtAfter: Date? = nil, createdAtBefore: Date? = nil, maxResults: Int? = nil, mode: JobRunMode? = nil, nextToken: String? = nil, states: [JobRunState]? = nil) {
            self.applicationId = applicationId
            self.createdAtAfter = createdAtAfter
            self.createdAtBefore = createdAtBefore
            self.maxResults = maxResults
            self.mode = mode
            self.nextToken = nextToken
            self.states = states
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.applicationId, key: "applicationId")
            request.encodeQuery(self.createdAtAfter, key: "createdAtAfter")
            request.encodeQuery(self.createdAtBefore, key: "createdAtBefore")
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.mode, key: "mode")
            request.encodeQuery(self.nextToken, key: "nextToken")
            request.encodeQuery(self.states, key: "states")
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationId, name: "applicationId", parent: name, max: 64)
            try self.validate(self.applicationId, name: "applicationId", parent: name, min: 1)
            try self.validate(self.applicationId, name: "applicationId", parent: name, pattern: "^[0-9a-z]+$")
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 1024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[A-Za-z0-9_=-]+$")
            try self.validate(self.states, name: "states", parent: name, max: 8)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListJobRunsResponse: AWSDecodableShape {
        /// The output lists information about the specified job runs.
        public let jobRuns: [JobRunSummary]
        /// The output displays the token for the next set of job run results. This is required for pagination and is available as a response of the previous request.
        public let nextToken: String?

        @inlinable
        public init(jobRuns: [JobRunSummary], nextToken: String? = nil) {
            self.jobRuns = jobRuns
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case jobRuns = "jobRuns"
            case nextToken = "nextToken"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) that identifies the resource to list the tags for. Currently, the supported resources are Amazon EMR Serverless applications and job runs.
        public let resourceArn: String

        @inlinable
        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.resourceArn, key: "resourceArn")
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1024)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 60)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z0-9-]*):emr-serverless:.+:(\\d{12}):\\/applications\\/[0-9a-zA-Z]+(\\/jobruns\\/[0-9a-zA-Z]+)?$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// The tags for the resource.
        public let tags: [String: String]?

        @inlinable
        public init(tags: [String: String]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "tags"
        }
    }

    public struct ManagedPersistenceMonitoringConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// Enables managed logging and defaults to true. If set to false, managed logging will be turned off.
        public let enabled: Bool?
        /// The KMS key ARN to encrypt the logs stored in managed log persistence.
        public let encryptionKeyArn: String?

        @inlinable
        public init(enabled: Bool? = nil, encryptionKeyArn: String? = nil) {
            self.enabled = enabled
            self.encryptionKeyArn = encryptionKeyArn
        }

        public func validate(name: String) throws {
            try self.validate(self.encryptionKeyArn, name: "encryptionKeyArn", parent: name, max: 2048)
            try self.validate(self.encryptionKeyArn, name: "encryptionKeyArn", parent: name, min: 20)
            try self.validate(self.encryptionKeyArn, name: "encryptionKeyArn", parent: name, pattern: "^arn:(aws[a-zA-Z0-9-]*):kms:[a-zA-Z0-9\\-]*:([0-9]{12}):key\\/[a-zA-Z0-9-]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case enabled = "enabled"
            case encryptionKeyArn = "encryptionKeyArn"
        }
    }

    public struct MaximumAllowedResources: AWSEncodableShape & AWSDecodableShape {
        /// The maximum allowed CPU for an application.
        public let cpu: String
        /// The maximum allowed disk for an application.
        public let disk: String?
        /// The maximum allowed resources for an application.
        public let memory: String

        @inlinable
        public init(cpu: String, disk: String? = nil, memory: String) {
            self.cpu = cpu
            self.disk = disk
            self.memory = memory
        }

        public func validate(name: String) throws {
            try self.validate(self.cpu, name: "cpu", parent: name, max: 15)
            try self.validate(self.cpu, name: "cpu", parent: name, min: 1)
            try self.validate(self.cpu, name: "cpu", parent: name, pattern: "^[1-9][0-9]*(\\s)?(vCPU|vcpu|VCPU)?$")
            try self.validate(self.disk, name: "disk", parent: name, max: 15)
            try self.validate(self.disk, name: "disk", parent: name, min: 1)
            try self.validate(self.disk, name: "disk", parent: name, pattern: "^[1-9][0-9]*(\\s)?(GB|gb|gB|Gb)$")
            try self.validate(self.memory, name: "memory", parent: name, max: 15)
            try self.validate(self.memory, name: "memory", parent: name, min: 1)
            try self.validate(self.memory, name: "memory", parent: name, pattern: "^[1-9][0-9]*(\\s)?(GB|gb|gB|Gb)?$")
        }

        private enum CodingKeys: String, CodingKey {
            case cpu = "cpu"
            case disk = "disk"
            case memory = "memory"
        }
    }

    public struct MonitoringConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The Amazon CloudWatch configuration for monitoring logs. You can configure your jobs to send log information to CloudWatch.
        public let cloudWatchLoggingConfiguration: CloudWatchLoggingConfiguration?
        /// The managed log persistence configuration for a job run.
        public let managedPersistenceMonitoringConfiguration: ManagedPersistenceMonitoringConfiguration?
        /// The monitoring configuration object you can configure to send metrics to Amazon Managed Service for Prometheus for a job run.
        public let prometheusMonitoringConfiguration: PrometheusMonitoringConfiguration?
        /// The Amazon S3 configuration for monitoring log publishing.
        public let s3MonitoringConfiguration: S3MonitoringConfiguration?

        @inlinable
        public init(cloudWatchLoggingConfiguration: CloudWatchLoggingConfiguration? = nil, managedPersistenceMonitoringConfiguration: ManagedPersistenceMonitoringConfiguration? = nil, prometheusMonitoringConfiguration: PrometheusMonitoringConfiguration? = nil, s3MonitoringConfiguration: S3MonitoringConfiguration? = nil) {
            self.cloudWatchLoggingConfiguration = cloudWatchLoggingConfiguration
            self.managedPersistenceMonitoringConfiguration = managedPersistenceMonitoringConfiguration
            self.prometheusMonitoringConfiguration = prometheusMonitoringConfiguration
            self.s3MonitoringConfiguration = s3MonitoringConfiguration
        }

        public func validate(name: String) throws {
            try self.cloudWatchLoggingConfiguration?.validate(name: "\(name).cloudWatchLoggingConfiguration")
            try self.managedPersistenceMonitoringConfiguration?.validate(name: "\(name).managedPersistenceMonitoringConfiguration")
            try self.prometheusMonitoringConfiguration?.validate(name: "\(name).prometheusMonitoringConfiguration")
            try self.s3MonitoringConfiguration?.validate(name: "\(name).s3MonitoringConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case cloudWatchLoggingConfiguration = "cloudWatchLoggingConfiguration"
            case managedPersistenceMonitoringConfiguration = "managedPersistenceMonitoringConfiguration"
            case prometheusMonitoringConfiguration = "prometheusMonitoringConfiguration"
            case s3MonitoringConfiguration = "s3MonitoringConfiguration"
        }
    }

    public struct NetworkConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The array of security group Ids for customer VPC connectivity.
        public let securityGroupIds: [String]?
        /// The array of subnet Ids for customer VPC connectivity.
        public let subnetIds: [String]?

        @inlinable
        public init(securityGroupIds: [String]? = nil, subnetIds: [String]? = nil) {
            self.securityGroupIds = securityGroupIds
            self.subnetIds = subnetIds
        }

        public func validate(name: String) throws {
            try self.securityGroupIds?.forEach {
                try validate($0, name: "securityGroupIds[]", parent: name, max: 32)
                try validate($0, name: "securityGroupIds[]", parent: name, min: 1)
                try validate($0, name: "securityGroupIds[]", parent: name, pattern: "^[-0-9a-zA-Z]+")
            }
            try self.validate(self.securityGroupIds, name: "securityGroupIds", parent: name, max: 5)
            try self.subnetIds?.forEach {
                try validate($0, name: "subnetIds[]", parent: name, max: 32)
                try validate($0, name: "subnetIds[]", parent: name, min: 1)
                try validate($0, name: "subnetIds[]", parent: name, pattern: "^[-0-9a-zA-Z]+")
            }
            try self.validate(self.subnetIds, name: "subnetIds", parent: name, max: 16)
        }

        private enum CodingKeys: String, CodingKey {
            case securityGroupIds = "securityGroupIds"
            case subnetIds = "subnetIds"
        }
    }

    public struct PrometheusMonitoringConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The remote write URL in the Amazon Managed Service for Prometheus workspace to send metrics to.
        public let remoteWriteUrl: String?

        @inlinable
        public init(remoteWriteUrl: String? = nil) {
            self.remoteWriteUrl = remoteWriteUrl
        }

        public func validate(name: String) throws {
            try self.validate(self.remoteWriteUrl, name: "remoteWriteUrl", parent: name, max: 10280)
            try self.validate(self.remoteWriteUrl, name: "remoteWriteUrl", parent: name, min: 1)
            try self.validate(self.remoteWriteUrl, name: "remoteWriteUrl", parent: name, pattern: "^https://aps-workspaces.([a-z]{2}-[a-z-]{1,20}-[1-9]).amazonaws(.[0-9A-Za-z]{2,4})+/workspaces/[-_.0-9A-Za-z]{1,100}/api/v1/remote_write$")
        }

        private enum CodingKeys: String, CodingKey {
            case remoteWriteUrl = "remoteWriteUrl"
        }
    }

    public struct ResourceUtilization: AWSDecodableShape {
        /// The aggregated memory used per hour from the time the job starts executing until the job is terminated.
        public let memoryGBHour: Double?
        /// The aggregated storage used per hour from the time the job starts executing until the job is terminated.
        public let storageGBHour: Double?
        /// The aggregated vCPU used per hour from the time the job starts executing until the job is terminated.
        public let vCPUHour: Double?

        @inlinable
        public init(memoryGBHour: Double? = nil, storageGBHour: Double? = nil, vCPUHour: Double? = nil) {
            self.memoryGBHour = memoryGBHour
            self.storageGBHour = storageGBHour
            self.vCPUHour = vCPUHour
        }

        private enum CodingKeys: String, CodingKey {
            case memoryGBHour = "memoryGBHour"
            case storageGBHour = "storageGBHour"
            case vCPUHour = "vCPUHour"
        }
    }

    public struct RetryPolicy: AWSEncodableShape & AWSDecodableShape {
        /// Maximum number of attempts for the job run. This parameter is only applicable for BATCH mode.
        public let maxAttempts: Int?
        /// Maximum number of failed attempts per hour. This [arameter is only applicable for STREAMING mode.
        public let maxFailedAttemptsPerHour: Int?

        @inlinable
        public init(maxAttempts: Int? = nil, maxFailedAttemptsPerHour: Int? = nil) {
            self.maxAttempts = maxAttempts
            self.maxFailedAttemptsPerHour = maxFailedAttemptsPerHour
        }

        public func validate(name: String) throws {
            try self.validate(self.maxAttempts, name: "maxAttempts", parent: name, min: 1)
        }

        private enum CodingKeys: String, CodingKey {
            case maxAttempts = "maxAttempts"
            case maxFailedAttemptsPerHour = "maxFailedAttemptsPerHour"
        }
    }

    public struct S3MonitoringConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The KMS key ARN to encrypt the logs published to the given Amazon S3 destination.
        public let encryptionKeyArn: String?
        /// The Amazon S3 destination URI for log publishing.
        public let logUri: String?

        @inlinable
        public init(encryptionKeyArn: String? = nil, logUri: String? = nil) {
            self.encryptionKeyArn = encryptionKeyArn
            self.logUri = logUri
        }

        public func validate(name: String) throws {
            try self.validate(self.encryptionKeyArn, name: "encryptionKeyArn", parent: name, max: 2048)
            try self.validate(self.encryptionKeyArn, name: "encryptionKeyArn", parent: name, min: 20)
            try self.validate(self.encryptionKeyArn, name: "encryptionKeyArn", parent: name, pattern: "^arn:(aws[a-zA-Z0-9-]*):kms:[a-zA-Z0-9\\-]*:([0-9]{12}):key\\/[a-zA-Z0-9-]+$")
            try self.validate(self.logUri, name: "logUri", parent: name, max: 10280)
            try self.validate(self.logUri, name: "logUri", parent: name, min: 1)
            try self.validate(self.logUri, name: "logUri", parent: name, pattern: "[\\u0020-\\uD7FF\\uE000-\\uFFFD\\uD800\\uDBFF-\\uDC00\\uDFFF\\r\\n\\t]*")
        }

        private enum CodingKeys: String, CodingKey {
            case encryptionKeyArn = "encryptionKeyArn"
            case logUri = "logUri"
        }
    }

    public struct SchedulerConfiguration: AWSEncodableShape & AWSDecodableShape {
        /// The maximum concurrent job runs on this application. If scheduler configuration is enabled on your application, the default value is 15. The valid range is 1 to 1000.
        public let maxConcurrentRuns: Int?
        /// The maximum duration in minutes for the job in QUEUED state. If scheduler configuration is enabled on your application, the default value is 360 minutes (6 hours). The valid range is from 15 to 720.
        public let queueTimeoutMinutes: Int?

        @inlinable
        public init(maxConcurrentRuns: Int? = nil, queueTimeoutMinutes: Int? = nil) {
            self.maxConcurrentRuns = maxConcurrentRuns
            self.queueTimeoutMinutes = queueTimeoutMinutes
        }

        private enum CodingKeys: String, CodingKey {
            case maxConcurrentRuns = "maxConcurrentRuns"
            case queueTimeoutMinutes = "queueTimeoutMinutes"
        }
    }

    public struct SparkSubmit: AWSEncodableShape & AWSDecodableShape {
        /// The entry point for the Spark submit job run.
        public let entryPoint: String
        /// The arguments for the Spark submit job run.
        public let entryPointArguments: [String]?
        /// The parameters for the Spark submit job run.
        public let sparkSubmitParameters: String?

        @inlinable
        public init(entryPoint: String, entryPointArguments: [String]? = nil, sparkSubmitParameters: String? = nil) {
            self.entryPoint = entryPoint
            self.entryPointArguments = entryPointArguments
            self.sparkSubmitParameters = sparkSubmitParameters
        }

        public func validate(name: String) throws {
            try self.validate(self.entryPoint, name: "entryPoint", parent: name, max: 4096)
            try self.validate(self.entryPoint, name: "entryPoint", parent: name, min: 1)
            try self.validate(self.entryPoint, name: "entryPoint", parent: name, pattern: ".*\\S.*")
            try self.entryPointArguments?.forEach {
                try validate($0, name: "entryPointArguments[]", parent: name, min: 1)
                try validate($0, name: "entryPointArguments[]", parent: name, pattern: ".*\\S.*")
            }
            try self.validate(self.entryPointArguments, name: "entryPointArguments", parent: name, max: 1024)
            try self.validate(self.sparkSubmitParameters, name: "sparkSubmitParameters", parent: name, max: 102400)
            try self.validate(self.sparkSubmitParameters, name: "sparkSubmitParameters", parent: name, min: 1)
            try self.validate(self.sparkSubmitParameters, name: "sparkSubmitParameters", parent: name, pattern: ".*\\S.*")
        }

        private enum CodingKeys: String, CodingKey {
            case entryPoint = "entryPoint"
            case entryPointArguments = "entryPointArguments"
            case sparkSubmitParameters = "sparkSubmitParameters"
        }
    }

    public struct StartApplicationRequest: AWSEncodableShape {
        /// The ID of the application to start.
        public let applicationId: String

        @inlinable
        public init(applicationId: String) {
            self.applicationId = applicationId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.applicationId, key: "applicationId")
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationId, name: "applicationId", parent: name, max: 64)
            try self.validate(self.applicationId, name: "applicationId", parent: name, min: 1)
            try self.validate(self.applicationId, name: "applicationId", parent: name, pattern: "^[0-9a-z]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct StartApplicationResponse: AWSDecodableShape {
        public init() {}
    }

    public struct StartJobRunRequest: AWSEncodableShape {
        /// The ID of the application on which to run the job.
        public let applicationId: String
        /// The client idempotency token of the job run to start. Its value must be unique for each request.
        public let clientToken: String
        /// The configuration overrides for the job run.
        public let configurationOverrides: ConfigurationOverrides?
        /// You can pass an optional IAM policy. The resulting job IAM role permissions will be an intersection of this policy and the policy associated with your job execution role.
        public let executionIamPolicy: JobRunExecutionIamPolicy?
        /// The execution role ARN for the job run.
        public let executionRoleArn: String
        /// The maximum duration for the job run to run. If the job run runs beyond this duration, it will be automatically cancelled.
        public let executionTimeoutMinutes: Int64?
        /// The job driver for the job run.
        public let jobDriver: JobDriver?
        /// The mode of the job run when it starts.
        public let mode: JobRunMode?
        /// The optional job run name. This doesn't have to be unique.
        public let name: String?
        /// The retry policy when job run starts.
        public let retryPolicy: RetryPolicy?
        /// The tags assigned to the job run.
        public let tags: [String: String]?

        @inlinable
        public init(applicationId: String, clientToken: String = StartJobRunRequest.idempotencyToken(), configurationOverrides: ConfigurationOverrides? = nil, executionIamPolicy: JobRunExecutionIamPolicy? = nil, executionRoleArn: String, executionTimeoutMinutes: Int64? = nil, jobDriver: JobDriver? = nil, mode: JobRunMode? = nil, name: String? = nil, retryPolicy: RetryPolicy? = nil, tags: [String: String]? = nil) {
            self.applicationId = applicationId
            self.clientToken = clientToken
            self.configurationOverrides = configurationOverrides
            self.executionIamPolicy = executionIamPolicy
            self.executionRoleArn = executionRoleArn
            self.executionTimeoutMinutes = executionTimeoutMinutes
            self.jobDriver = jobDriver
            self.mode = mode
            self.name = name
            self.retryPolicy = retryPolicy
            self.tags = tags
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.applicationId, key: "applicationId")
            try container.encode(self.clientToken, forKey: .clientToken)
            try container.encodeIfPresent(self.configurationOverrides, forKey: .configurationOverrides)
            try container.encodeIfPresent(self.executionIamPolicy, forKey: .executionIamPolicy)
            try container.encode(self.executionRoleArn, forKey: .executionRoleArn)
            try container.encodeIfPresent(self.executionTimeoutMinutes, forKey: .executionTimeoutMinutes)
            try container.encodeIfPresent(self.jobDriver, forKey: .jobDriver)
            try container.encodeIfPresent(self.mode, forKey: .mode)
            try container.encodeIfPresent(self.name, forKey: .name)
            try container.encodeIfPresent(self.retryPolicy, forKey: .retryPolicy)
            try container.encodeIfPresent(self.tags, forKey: .tags)
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationId, name: "applicationId", parent: name, max: 64)
            try self.validate(self.applicationId, name: "applicationId", parent: name, min: 1)
            try self.validate(self.applicationId, name: "applicationId", parent: name, pattern: "^[0-9a-z]+$")
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 64)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "^[A-Za-z0-9._-]+$")
            try self.configurationOverrides?.validate(name: "\(name).configurationOverrides")
            try self.executionIamPolicy?.validate(name: "\(name).executionIamPolicy")
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, max: 2048)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, min: 20)
            try self.validate(self.executionRoleArn, name: "executionRoleArn", parent: name, pattern: "^arn:(aws[a-zA-Z0-9-]*):iam::([0-9]{12}):(role((\\u002F)|(\\u002F[\\u0021-\\u007F]+\\u002F))[\\w+=,.@-]+)$")
            try self.validate(self.executionTimeoutMinutes, name: "executionTimeoutMinutes", parent: name, max: 1000000)
            try self.validate(self.executionTimeoutMinutes, name: "executionTimeoutMinutes", parent: name, min: 0)
            try self.jobDriver?.validate(name: "\(name).jobDriver")
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: ".*\\S.*")
            try self.retryPolicy?.validate(name: "\(name).retryPolicy")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^[A-Za-z0-9 /_.:=+@-]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "^[A-Za-z0-9 /_.:=+@-]*$")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case clientToken = "clientToken"
            case configurationOverrides = "configurationOverrides"
            case executionIamPolicy = "executionIamPolicy"
            case executionRoleArn = "executionRoleArn"
            case executionTimeoutMinutes = "executionTimeoutMinutes"
            case jobDriver = "jobDriver"
            case mode = "mode"
            case name = "name"
            case retryPolicy = "retryPolicy"
            case tags = "tags"
        }
    }

    public struct StartJobRunResponse: AWSDecodableShape {
        /// This output displays the application ID on which the job run was submitted.
        public let applicationId: String
        /// This output displays the ARN of the job run..
        public let arn: String
        /// The output contains the ID of the started job run.
        public let jobRunId: String

        @inlinable
        public init(applicationId: String, arn: String, jobRunId: String) {
            self.applicationId = applicationId
            self.arn = arn
            self.jobRunId = jobRunId
        }

        private enum CodingKeys: String, CodingKey {
            case applicationId = "applicationId"
            case arn = "arn"
            case jobRunId = "jobRunId"
        }
    }

    public struct StopApplicationRequest: AWSEncodableShape {
        /// The ID of the application to stop.
        public let applicationId: String

        @inlinable
        public init(applicationId: String) {
            self.applicationId = applicationId
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.applicationId, key: "applicationId")
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationId, name: "applicationId", parent: name, max: 64)
            try self.validate(self.applicationId, name: "applicationId", parent: name, min: 1)
            try self.validate(self.applicationId, name: "applicationId", parent: name, pattern: "^[0-9a-z]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct StopApplicationResponse: AWSDecodableShape {
        public init() {}
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) that identifies the resource to list the tags for. Currently, the supported resources are Amazon EMR Serverless applications and job runs.
        public let resourceArn: String
        /// The tags to add to the resource. A tag is an array of key-value pairs.
        public let tags: [String: String]

        @inlinable
        public init(resourceArn: String, tags: [String: String]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.resourceArn, key: "resourceArn")
            try container.encode(self.tags, forKey: .tags)
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1024)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 60)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z0-9-]*):emr-serverless:.+:(\\d{12}):\\/applications\\/[0-9a-zA-Z]+(\\/jobruns\\/[0-9a-zA-Z]+)?$")
            try self.tags.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^[A-Za-z0-9 /_.:=+@-]+$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "^[A-Za-z0-9 /_.:=+@-]*$")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 200)
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct TotalResourceUtilization: AWSDecodableShape {
        /// The aggregated memory used per hour from the time job start executing till the time job is terminated.
        public let memoryGBHour: Double?
        /// The aggregated storage used per hour from the time job start executing till the time job is terminated.
        public let storageGBHour: Double?
        /// The aggregated vCPU used per hour from the time job start executing till the time job is terminated.
        public let vCPUHour: Double?

        @inlinable
        public init(memoryGBHour: Double? = nil, storageGBHour: Double? = nil, vCPUHour: Double? = nil) {
            self.memoryGBHour = memoryGBHour
            self.storageGBHour = storageGBHour
            self.vCPUHour = vCPUHour
        }

        private enum CodingKeys: String, CodingKey {
            case memoryGBHour = "memoryGBHour"
            case storageGBHour = "storageGBHour"
            case vCPUHour = "vCPUHour"
        }
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The Amazon Resource Name (ARN) that identifies the resource to list the tags for. Currently, the supported resources are Amazon EMR Serverless applications and job runs.
        public let resourceArn: String
        /// The keys of the tags to be removed.
        public let tagKeys: [String]

        @inlinable
        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.resourceArn, key: "resourceArn")
            request.encodeQuery(self.tagKeys, key: "tagKeys")
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1024)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 60)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z0-9-]*):emr-serverless:.+:(\\d{12}):\\/applications\\/[0-9a-zA-Z]+(\\/jobruns\\/[0-9a-zA-Z]+)?$")
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
                try validate($0, name: "tagKeys[]", parent: name, pattern: "^[A-Za-z0-9 /_.:=+@-]+$")
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 200)
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateApplicationRequest: AWSEncodableShape {
        /// The ID of the application to update.
        public let applicationId: String
        /// The CPU architecture of an application.
        public let architecture: Architecture?
        /// The configuration for an application to automatically start on job submission.
        public let autoStartConfiguration: AutoStartConfig?
        /// The configuration for an application to automatically stop after a certain amount of time being idle.
        public let autoStopConfiguration: AutoStopConfig?
        /// The client idempotency token of the application to update. Its value must be unique for each request.
        public let clientToken: String
        /// Specifies the IAM Identity Center configuration used to enable or disable trusted identity propagation. When provided, this configuration determines how the application interacts with IAM Identity Center for user authentication and access control.
        public let identityCenterConfiguration: IdentityCenterConfigurationInput?
        /// The image configuration to be used for all worker types. You can either set this parameter or imageConfiguration for each worker type in WorkerTypeSpecificationInput.
        public let imageConfiguration: ImageConfigurationInput?
        /// The capacity to initialize when the application is updated.
        public let initialCapacity: [String: InitialCapacityConfig]?
        /// The interactive configuration object that contains new interactive use cases when the application is updated.
        public let interactiveConfiguration: InteractiveConfiguration?
        /// The maximum capacity to allocate when the application is updated. This is cumulative across all workers at any given point in time during the lifespan of the application. No new resources will be created once any one of the defined limits is hit.
        public let maximumCapacity: MaximumAllowedResources?
        /// The configuration setting for monitoring.
        public let monitoringConfiguration: MonitoringConfiguration?
        public let networkConfiguration: NetworkConfiguration?
        /// The Amazon EMR release label for the application. You can change the release label to use a different release of Amazon EMR.
        public let releaseLabel: String?
        /// The Configuration specifications to use when updating an application. Each configuration consists of a classification and properties. This configuration is applied across all the job runs submitted under the application.
        public let runtimeConfiguration: [Configuration]?
        /// The scheduler configuration for batch and streaming jobs running on this application. Supported with release labels emr-7.0.0 and above.
        public let schedulerConfiguration: SchedulerConfiguration?
        /// The key-value pairs that specify worker type to WorkerTypeSpecificationInput. This parameter must contain all valid worker types for a Spark or Hive application. Valid worker types include Driver and Executor for Spark applications and HiveDriver and TezTask for Hive applications. You can either set image details in this parameter for each worker type, or in imageConfiguration for all worker types.
        public let workerTypeSpecifications: [String: WorkerTypeSpecificationInput]?

        @inlinable
        public init(applicationId: String, architecture: Architecture? = nil, autoStartConfiguration: AutoStartConfig? = nil, autoStopConfiguration: AutoStopConfig? = nil, clientToken: String = UpdateApplicationRequest.idempotencyToken(), identityCenterConfiguration: IdentityCenterConfigurationInput? = nil, imageConfiguration: ImageConfigurationInput? = nil, initialCapacity: [String: InitialCapacityConfig]? = nil, interactiveConfiguration: InteractiveConfiguration? = nil, maximumCapacity: MaximumAllowedResources? = nil, monitoringConfiguration: MonitoringConfiguration? = nil, networkConfiguration: NetworkConfiguration? = nil, releaseLabel: String? = nil, runtimeConfiguration: [Configuration]? = nil, schedulerConfiguration: SchedulerConfiguration? = nil, workerTypeSpecifications: [String: WorkerTypeSpecificationInput]? = nil) {
            self.applicationId = applicationId
            self.architecture = architecture
            self.autoStartConfiguration = autoStartConfiguration
            self.autoStopConfiguration = autoStopConfiguration
            self.clientToken = clientToken
            self.identityCenterConfiguration = identityCenterConfiguration
            self.imageConfiguration = imageConfiguration
            self.initialCapacity = initialCapacity
            self.interactiveConfiguration = interactiveConfiguration
            self.maximumCapacity = maximumCapacity
            self.monitoringConfiguration = monitoringConfiguration
            self.networkConfiguration = networkConfiguration
            self.releaseLabel = releaseLabel
            self.runtimeConfiguration = runtimeConfiguration
            self.schedulerConfiguration = schedulerConfiguration
            self.workerTypeSpecifications = workerTypeSpecifications
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.applicationId, key: "applicationId")
            try container.encodeIfPresent(self.architecture, forKey: .architecture)
            try container.encodeIfPresent(self.autoStartConfiguration, forKey: .autoStartConfiguration)
            try container.encodeIfPresent(self.autoStopConfiguration, forKey: .autoStopConfiguration)
            try container.encode(self.clientToken, forKey: .clientToken)
            try container.encodeIfPresent(self.identityCenterConfiguration, forKey: .identityCenterConfiguration)
            try container.encodeIfPresent(self.imageConfiguration, forKey: .imageConfiguration)
            try container.encodeIfPresent(self.initialCapacity, forKey: .initialCapacity)
            try container.encodeIfPresent(self.interactiveConfiguration, forKey: .interactiveConfiguration)
            try container.encodeIfPresent(self.maximumCapacity, forKey: .maximumCapacity)
            try container.encodeIfPresent(self.monitoringConfiguration, forKey: .monitoringConfiguration)
            try container.encodeIfPresent(self.networkConfiguration, forKey: .networkConfiguration)
            try container.encodeIfPresent(self.releaseLabel, forKey: .releaseLabel)
            try container.encodeIfPresent(self.runtimeConfiguration, forKey: .runtimeConfiguration)
            try container.encodeIfPresent(self.schedulerConfiguration, forKey: .schedulerConfiguration)
            try container.encodeIfPresent(self.workerTypeSpecifications, forKey: .workerTypeSpecifications)
        }

        public func validate(name: String) throws {
            try self.validate(self.applicationId, name: "applicationId", parent: name, max: 64)
            try self.validate(self.applicationId, name: "applicationId", parent: name, min: 1)
            try self.validate(self.applicationId, name: "applicationId", parent: name, pattern: "^[0-9a-z]+$")
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 64)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "^[A-Za-z0-9._-]+$")
            try self.identityCenterConfiguration?.validate(name: "\(name).identityCenterConfiguration")
            try self.imageConfiguration?.validate(name: "\(name).imageConfiguration")
            try self.initialCapacity?.forEach {
                try validate($0.key, name: "initialCapacity.key", parent: name, max: 50)
                try validate($0.key, name: "initialCapacity.key", parent: name, min: 1)
                try validate($0.key, name: "initialCapacity.key", parent: name, pattern: "^[a-zA-Z]+[-_]*[a-zA-Z]+$")
                try $0.value.validate(name: "\(name).initialCapacity[\"\($0.key)\"]")
            }
            try self.validate(self.initialCapacity, name: "initialCapacity", parent: name, max: 10)
            try self.maximumCapacity?.validate(name: "\(name).maximumCapacity")
            try self.monitoringConfiguration?.validate(name: "\(name).monitoringConfiguration")
            try self.networkConfiguration?.validate(name: "\(name).networkConfiguration")
            try self.validate(self.releaseLabel, name: "releaseLabel", parent: name, max: 64)
            try self.validate(self.releaseLabel, name: "releaseLabel", parent: name, min: 1)
            try self.validate(self.releaseLabel, name: "releaseLabel", parent: name, pattern: "^[A-Za-z0-9._/-]+$")
            try self.runtimeConfiguration?.forEach {
                try $0.validate(name: "\(name).runtimeConfiguration[]")
            }
            try self.validate(self.runtimeConfiguration, name: "runtimeConfiguration", parent: name, max: 100)
            try self.workerTypeSpecifications?.forEach {
                try validate($0.key, name: "workerTypeSpecifications.key", parent: name, max: 50)
                try validate($0.key, name: "workerTypeSpecifications.key", parent: name, min: 1)
                try validate($0.key, name: "workerTypeSpecifications.key", parent: name, pattern: "^[a-zA-Z]+[-_]*[a-zA-Z]+$")
                try $0.value.validate(name: "\(name).workerTypeSpecifications[\"\($0.key)\"]")
            }
        }

        private enum CodingKeys: String, CodingKey {
            case architecture = "architecture"
            case autoStartConfiguration = "autoStartConfiguration"
            case autoStopConfiguration = "autoStopConfiguration"
            case clientToken = "clientToken"
            case identityCenterConfiguration = "identityCenterConfiguration"
            case imageConfiguration = "imageConfiguration"
            case initialCapacity = "initialCapacity"
            case interactiveConfiguration = "interactiveConfiguration"
            case maximumCapacity = "maximumCapacity"
            case monitoringConfiguration = "monitoringConfiguration"
            case networkConfiguration = "networkConfiguration"
            case releaseLabel = "releaseLabel"
            case runtimeConfiguration = "runtimeConfiguration"
            case schedulerConfiguration = "schedulerConfiguration"
            case workerTypeSpecifications = "workerTypeSpecifications"
        }
    }

    public struct UpdateApplicationResponse: AWSDecodableShape {
        /// Information about the updated application.
        public let application: Application

        @inlinable
        public init(application: Application) {
            self.application = application
        }

        private enum CodingKeys: String, CodingKey {
            case application = "application"
        }
    }

    public struct WorkerResourceConfig: AWSEncodableShape & AWSDecodableShape {
        /// The CPU requirements for every worker instance of the worker type.
        public let cpu: String
        /// The disk requirements for every worker instance of the worker type.
        public let disk: String?
        /// The disk type for every worker instance of the work type. Shuffle optimized disks have higher performance characteristics and are better for shuffle heavy workloads. Default is STANDARD.
        public let diskType: String?
        /// The memory requirements for every worker instance of the worker type.
        public let memory: String

        @inlinable
        public init(cpu: String, disk: String? = nil, diskType: String? = nil, memory: String) {
            self.cpu = cpu
            self.disk = disk
            self.diskType = diskType
            self.memory = memory
        }

        public func validate(name: String) throws {
            try self.validate(self.cpu, name: "cpu", parent: name, max: 15)
            try self.validate(self.cpu, name: "cpu", parent: name, min: 1)
            try self.validate(self.cpu, name: "cpu", parent: name, pattern: "^[1-9][0-9]*(\\s)?(vCPU|vcpu|VCPU)?$")
            try self.validate(self.disk, name: "disk", parent: name, max: 15)
            try self.validate(self.disk, name: "disk", parent: name, min: 1)
            try self.validate(self.disk, name: "disk", parent: name, pattern: "^[1-9][0-9]*(\\s)?(GB|gb|gB|Gb)$")
            try self.validate(self.diskType, name: "diskType", parent: name, pattern: "^(SHUFFLE_OPTIMIZED|[Ss]huffle_[Oo]ptimized|STANDARD|[Ss]tandard)$")
            try self.validate(self.memory, name: "memory", parent: name, max: 15)
            try self.validate(self.memory, name: "memory", parent: name, min: 1)
            try self.validate(self.memory, name: "memory", parent: name, pattern: "^[1-9][0-9]*(\\s)?(GB|gb|gB|Gb)?$")
        }

        private enum CodingKeys: String, CodingKey {
            case cpu = "cpu"
            case disk = "disk"
            case diskType = "diskType"
            case memory = "memory"
        }
    }

    public struct WorkerTypeSpecification: AWSDecodableShape {
        /// The image configuration for a worker type.
        public let imageConfiguration: ImageConfiguration?

        @inlinable
        public init(imageConfiguration: ImageConfiguration? = nil) {
            self.imageConfiguration = imageConfiguration
        }

        private enum CodingKeys: String, CodingKey {
            case imageConfiguration = "imageConfiguration"
        }
    }

    public struct WorkerTypeSpecificationInput: AWSEncodableShape {
        /// The image configuration for a worker type.
        public let imageConfiguration: ImageConfigurationInput?

        @inlinable
        public init(imageConfiguration: ImageConfigurationInput? = nil) {
            self.imageConfiguration = imageConfiguration
        }

        public func validate(name: String) throws {
            try self.imageConfiguration?.validate(name: "\(name).imageConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case imageConfiguration = "imageConfiguration"
        }
    }
}

// MARK: - Errors

/// Error enum for EMRServerless
public struct EMRServerlessErrorType: AWSErrorType {
    enum Code: String {
        case conflictException = "ConflictException"
        case internalServerException = "InternalServerException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case serviceQuotaExceededException = "ServiceQuotaExceededException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize EMRServerless
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// The request could not be processed because of conflict in the current state of the resource.
    public static var conflictException: Self { .init(.conflictException) }
    /// Request processing failed because of an error or failure with the service.
    public static var internalServerException: Self { .init(.internalServerException) }
    /// The specified resource was not found.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    /// The maximum number of resources per account has been reached.
    public static var serviceQuotaExceededException: Self { .init(.serviceQuotaExceededException) }
    /// The input fails to satisfy the constraints specified by an Amazon Web Services service.
    public static var validationException: Self { .init(.validationException) }
}

extension EMRServerlessErrorType: Equatable {
    public static func == (lhs: EMRServerlessErrorType, rhs: EMRServerlessErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension EMRServerlessErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
